<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
     <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" +request.getServerPort() + path + "/";
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script language="javascript" type="text/javascript" src="<%=basePath %>/js/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="<%=basePath %>/css/bootstrap.min.css">

<script type="text/javascript" src="<%=basePath %>/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/laypage/laypage.js"></script>
<script type="text/javascript" src="<%=basePath %>/js/vue.min.js"></script>

<style type="text/css">
@import url(../css/administrative.css);
#div1{
margin: 20px;
}
.teizi{
size: 10px;
font-weight: bold;
/* color: green; */
text-decoration: none;
}
.form-control{
width: 20%;

}
 #div9{
width: 100%;
height: 80px;
background: purple;
}

 .input-group-addon{
/*   width: 30%; */ 
margin-right: 10px;
 }
 
  #button{
float: right;

margin: 10px;
}
 
#time2{
float: left;
}
#zhong{
width: 100%;
height: 75px;
}
#zhongdiv{
width: 100%;
height: 75px;
}
#zhong2{
width: 100%;
height: 50px;
}
#zhong5{
width: 100%;
height: 50px;
}
#font1{
width: 100%;
height: 50px;
}
</style>
<script type="text/javascript">
/* 显示所有数据 */
/*   $(document).ready(
	function getSearch() {
		$.ajax({
			url:'../showPost',
			type:'post',
			dataType:'json',
			success:function(result){
				
				$.each(result.showpost,function(inx,ele){
					$("#table1").append(
							"<tr><td>"+"<input type='checkbox' name='item'>"+"</td><td>"+ele.ptmain+"</td><td>"+ele.author_id+"</td><td>"+
							ele.source+"</td><td>"+ele.lookcount+"</td><td>"+ele.state+"</td><td>"+ele.ptboard+"</td><td>"+ele.posted+"</td><td>"+
							+"</td><td>"+"操作"+"</td></tr>"
					)
				})
			}
		})
	})  */ 
/* 显示版块下拉框 */
$(document).ready(
	function getBored() {
		$.ajax({
			url:'../showBored',
			type:'post',
			dataType:'json',
			success:function(result){	
				$.each(result.showBored,function(inx,ele){
					$("#grade,#grade1,#grade3,#grade5,#grade8").append(
							"<option value=" + (ele.bor_id) + ">"
							+ ele.bor_name + "</option>");
				})
			}
		})
	})
	//版块下拉框自动获取id  绑定模态框
 var getBoreds =function(){
 	var select=document.getElementById("grade"); 
	 var select1=document.getElementById("grade1"); 
	  var select2=document.getElementById("grade3");   
	   var select5=document.getElementById("grade5");  
	 var bor_id1=select1.value; 
	  var bor_id2=select2.value;  
	 var bor_id=select.value; 
	 var bor_id5=select5.value;  

	   $("#bor_id3").val(bor_id2)  
	 $("#bor_id").val(bor_id)
	 $("#bor_id1").val(bor_id1) 
	 $("#bor_id5").val(bor_id5)  
	 var select8=document.getElementById("grade8");  
	   var bor_id8=select8.value;  
	   $("#bor_id8").val(bor_id8) 
} 
//发帖子 向后端传递数据 新增
 function showBor() {
	 var bor_id=$("#bor_id").val();
	var ptmain=$("#ptmain").val();
 	var author_id=$("#author_id").val(); 
	var source=$("#source").val();
	var content=$("#content").val();
	
	$.ajax({
		url:'../addPost',
		type:'post',
		data:{'bor_id':bor_id,'ptmain':ptmain,'source':source,'author_id':author_id,'content':content},
		dataType:'json',
		success:function(res){
			
			getSearch(1);
			getSearchs(1);
			
		}
	})
} 


//发帖子 待审批向后端传递数据 新增
 function showBors() {
	 var bor_id=$("#bor_id5").val();
	var ptmain=$("#ptmain5").val();
 	var author_id=$("#author_id5").val(); 
	var source=$("#source5").val();
	var content=$("#content5").val();

	$.ajax({
		url:'../addPost',
		type:'post',
		data:{'bor_id':bor_id,'ptmain':ptmain,'source':source,'author_id':author_id,'content':content},
		dataType:'json',
		success:function(res){
		getSearch(1);
		getSearchs(1);	
		
		}
	})
}

 /*全选/反选触发函数*/
 function applyAll(){
      var del = document.getElementById("check").checked;
      var arrState = document.getElementsByName("item");
      for(var i = 0;i<arrState.length;i++){
             arrState[i].checked = del;
      }
  }
 
 /*待审批  全选/反选触发函数*/
 function applyAlls(){
      var del = document.getElementById("check1").checked;
      var arrState = document.getElementsByName("item1");
      for(var i = 0;i<arrState.length;i++){
             arrState[i].checked = del;
      }
  }
//按条件查询
 	 $(document).ready(function(){
		 getSearch(1);
})  


	function getSearch(currentPage) {
 		 
		  var bor_id=$("#bor_id1").val();
			var ptmain=$("#ptmain1").val(); 
			var startTime=$("#startDate").val();
			var endTime=$("#endDate").val(); 

		$.ajax({
			url:'../querySends',
			type:'post',
	 		data:{bor_id:bor_id,ptmain:ptmain,currentPage:currentPage,startTime:startTime,endTime:endTime},  
			dataType:'json',
			success:function(result){	
				$("#table1").html("");
				  $("#table1").append("<tr class='success'>"
				  +"<th>"
				  +"<input type='checkbox' id='check' onclick='applyAll()'>"
				  +"</th><th>主题</th><th>发布人</th>"
							+"<th>来源</th>"
							+"<th>阅读次数</th>"
							+"<th>状态</th>"
							+"<th>版块</th>"
							+"<th>发布时间</th>"
							+"<th>操作</th></tr>");
			
				$.each(result.querysends,function(inx,ele){
					$("#table1").append(
							"<tr><td>"+"<input type='checkbox' name='item' id='item' value='"+ele.ptid+"'>"+"</td>"+"<td><a href=\"../lookPost?ptid="+ele.ptid+"\">"+ele.ptmain+"</a></td>"+"<td>"+ele.author_id+"</td><td>"+
							ele.source+"</td><td>"+ele.lookcount+"</td><td>"+ele.state+"</td><td>"+ele.bor_name+"</td><td>"+ele.posted+"</td><td>"
							+"<button type='button' class='btn btn-success' id='button' class='btn btn-primary btn-lg' data-toggle='modal' data-target='#updateModal' onclick='getByIdPost("+ele.ptid+")'>编辑</button>"+"</td></tr>"
					)
				})
				laypage({
				    cont: $("#laypage"),
				    pages:result.count,  //假设我们获取到的是18（后端计算完总页数后将总页数值传过来，放在这里即可（类似{$totalpage}））.
				    groups:5, //显示几页码 
				    skip: true, //是否开启跳页
				    skin: '#AF0000',
				    curr:currentPage,  //假设我们获取到的是18（后端计算完总页数后将总页数值传过来，放在这里即可（类似{$totalpage}））.
				    groups:3, //显示几页码currentPage,
				
				    jump: function(obj, first){ //触发分页后的回调
				        if(!first){ 	//一定要加此判断，否则初始时会无限刷新      
				        	getSearch(obj.curr); 
				        }
				    }
				});  
			}
		})
	} 
  
  
  //显示未审批的数据
 	  $(document).ready(function(){
		 getSearchs(1);
})  
	function getSearchs(currentPage) {
		  var bor_id=$("#bor_id3").val();
			var ptmain=$("#ptmain3").val(); 
			var startTime=$("#startDate3").val();
			var endTime=$("#endDate3").val();
		$.ajax({
			url:'../queryWaitPost',
			type:'post',
	 		data:{bor_id:bor_id,ptmain:ptmain,currentPage:currentPage,startTime:startTime,endTime:endTime},  
			dataType:'json',
			success:function(result){	
			
				$("#table2").html("");
				  $("#table2").append("<tr class='success'>"
				  +"<th>"
				  +"<input type='checkbox' id='check1' onclick='applyAlls()'>"
				  +"</th><th>主题</th><th>发布人</th>"
							+"<th>来源</th>"
							+"<th>阅读次数</th>"
							+"<th>状态</th>"
							+"<th>版块</th>"
							+"<th>发布时间</th>"
							+"<th>操作</th>"+
							"<th>是否审批</th>"+"</tr>");
				$.each(result.queryWaitPost,function(inx,ele){
					$("#table2").append(
							"<tr><td>"+"<input type='checkbox' name='item1' id='item1' value='"+ele.ptid+"'>"+"</td>"+"<td><a href=\"../lookPost?ptid="+ele.ptid+"\">"+ele.ptmain+"</a></td>"+"<td>"+ele.author_id+"</td><td>"+
							ele.source+"</td><td>"+ele.lookcount+"</td><td>"+ele.state+"</td><td>"+ele.bor_name+"</td><td>"+ele.posted+"</td><td>"
							+"<button type='button' class='btn btn-success' id='button' class='btn btn-primary btn-lg' data-toggle='modal' data-target='#updateModal1' onclick='getByIdPosts("+ele.ptid+")'>编辑</button>"+"</td><td>"+
							"<button type='button' class='btn btn-success' id='button2' class='btn btn-primary btn-lg' data-toggle='modal' data-target='#approve' onclick='getByIdApp("+ele.ptid+")'>审批</button>"+"</td></tr>"
					)
				})
				 laypage({
				    cont: $("#laypage1"),
				    pages:result.count,  //假设我们获取到的是18（后端计算完总页数后将总页数值传过来，放在这里即可（类似{$totalpage}））.
				    groups:5, //显示几页码 
				    skip: true, //是否开启跳页
				    skin: '#AF0000',
				    curr:currentPage,  //假设我们获取到的是18（后端计算完总页数后将总页数值传过来，放在这里即可（类似{$totalpage}））.
				    groups:3, //显示几页码currentPage,
				
				    jump: function(obj, first){ //触发分页后的回调
				        if(!first){ 	//一定要加此判断，否则初始时会无限刷新      
				        	getSearchs(obj.curr); 
				        }
				    }
				});   
			}
		})
	} 
</script>
<script type="text/javascript">

//删除  批量删除
function getDelete() {
	obj=document.getElementsByName("item");
	check_val=[];
	var str="";
	for(i in obj){
		if(obj[i].checked){
			str+=obj[i].value+","
			 check_val.push(obj[i].value);
		}
	}
		console.log(str)
		$.ajax({
			url:'../deletePost',
			data:{'str':str},
			dataType:'json',
			type:'post',
			success:function(res){
				if(res==1){
					alert("删除成功");
					getSearch(1);
					getSearchs(1);
				}
			
			}
		})
	}

//删除  批量删除
function getDeletes() {
	obj=document.getElementsByName("item1");
	check_val=[];
	var str="";
	for(i in obj){
		if(obj[i].checked){
			str+=obj[i].value+","
			 check_val.push(obj[i].value);
		}
	}
		console.log(str)
		$.ajax({
			url:'../deletePost',
			data:{'str':str},
			dataType:'json',
			type:'post',
			success:function(res){
				if(res==1){
					alert("删除成功");
					getSearch(1);
					getSearchs(1);
				}
			}
		})
	}

function getByIdPost(ID) {
	$("#bor_id2").val(ID);
	$("#bor_id3").val(ID);

}
function getByIdPosts(ID) {
	$("#bor_id4").val(ID);
}
function getByIdApp(ID){
	$("#button2").val(ID);
}
//修改编辑信息
function modifySend() {
	var ptid=$("#bor_id2").val();
	var ptmain=$("#ptmain2").val();
	var author_id=$("#author_id2").val();
	var source=$("#source2").val();
	var content=$("#content2").val();

	$.ajax({
		url:'../ModifyPost',
		type:'post',
		data:{ptid:ptid,ptmain:ptmain,author_id:author_id,source:source,content:content},
		dataType:'json',
		success:function(res){
			getSearch(1);
		}
	})
}

//修改编辑未审批的信息
function modifySends() {
	var ptid=$("#bor_id4").val();
	var ptmain=$("#ptmain4").val();
	var author_id=$("#author_id4").val();
	var source=$("#source4").val();
	var content=$("#content4").val();

	$.ajax({
		url:'../ModifyPost',
		type:'post',
		data:{ptid:ptid,ptmain:ptmain,author_id:author_id,source:source,content:content},
		dataType:'json',
		success:function(res){
			getSearch(1);
			getSearchs(1);
		}
	})
}

//是否审批
function getApprove(){
	var ptid=$("#button2").val();
	
	$.ajax({
		url:'../modifyState',
		data:{ptid:ptid},
		type:'post',
		dataType:'json',
		success:function(res){
			alert("审批成功")
			getSearch(1);
			getSearchs(1);
		}
	})
}

</script>

<div id="div1">交流论坛 》 发帖管理</div>
<!-- Unnamed (水平线) -->
      <img id="u6_line" class="img " src="../img/u199_line.png"/>
<ul class="tabs" id="tab-cat">
	<li class="current">
		<a href="#mianze" class="teizi">所有帖子</a></li>
	<li>
		<a href="#yinsi" class="teizi">待我审批的帖子</a></li>
		<li>
		<a href="#fuwu" class="teizi">我发布的帖子</a></li>

</ul>

<div class="sec_menu" id="mianze">
	<div class="sty1" id="styl1">
	<div id="mian">
	<div class="input-group input-group-sm">
	<span class="input-group-addon">版块</span>
					<select name="bor_name" class="form-control" id="grade1" onchange="getBoreds()">
						 <option value="0" selected="selected" >请选择查找版块</option>	 
					</select>
					<input type="hidden" id="bor_id1" name="bor_id" value="0">
	<span class="input-group-addon">主题</span>
	<input type="text" id="ptmain1" class="form-control" placeholder="请输入您要查找的主题">
						
	</div>
	
	<div id="zhong">
 	<div class="input-group input-group-sm">
	<span class="input-group-addon">开始时间</span>
<input type="text" class="form-control" id="startDate" placeholder="请输入您要查找的开始时间" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" >

<span class="input-group-addon">结束时间</span>
<input type="text" class="form-control" id="endDate" name="posted" placeholder="请输入您要查找的结束时间" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" >					
</div> 
			<button type="button" class="btn btn-success" id="button" onclick="getSearch(1)">查询</button>	
	</div>
	</div>
	<div id="zhong2">
	<button type="button" class="btn btn-success"  data-toggle="modal" data-target="#myModal">发表新贴</button>
	<button type="button" class="btn btn-danger"  data-toggle="modal" data-target="#deleModal">清除数据</button>
	</div>
	
<table class="table table-bordered" id="table1">

<thead>
 <tr class="success">
<th><input type="checkbox" id="check" onclick="applyAll()"></th>
<th>主题</th>
<th>发布人</th>
<th>来源</th>
<th>阅读次数</th>
<th>状态</th>
<th>版块</th>
<th>发布时间</th>
<th>操作</th>
</tr>
</thead>
<tbody >

</tbody>
</table>
<div id="laypage"></div>
	<!-- 新增新帖模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">发表新帖</h4>
</div>
<div class="modal-body">
<form action="../addPost">
<table style="line-height: 50px;">
<tr ><td>版块(*):</td><td><select name="ptboard" class="form-control" id="grade" style="width: 450px;margin-left: 20px;" onchange="getBoreds()">
						<option value="请选择版块" selected="selected" value="0">请选择查找版块</option>
					</select>
</tr>
<tr><td><input type="hidden" name="bor_id" id="bor_id" value="0"></td></tr>
<tr><td>主题(*):</td><td><input type="text" name="ptmain" id="ptmain" class="form-control" placeholder="请输入您要发表的主题" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>发布人:</td><td><input type="text" class="form-control" id="author_id" name="author_id" style="width: 450px;margin-left: 20px;" value="${obj.uname }"></td></tr>
<tr><td>来源:</td><td><input type="text" name="source" id="source" class="form-control" placeholder="请输入您发表信息的来源" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>内容: &nbsp;</td><td><textarea cols="66" rows="4"  id="content" name="content" id="reasons" placeholder="请输入您发表的内容" style="width: 450px;margin-left: 20px;"></textarea></td></tr>
</table>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<!-- <button type="button" class="btn btn-primary" data-dismiss="modal">发表</button> -->
<input type="button" class="btn btn-primary" data-dismiss="modal" value="发表" onclick="showBor()">
</div>
</div>
</div>
</div>
</div>

<!-- 修改编辑模态框（Modal） -->
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">编辑</h4>
</div>
<div class="modal-body">
<form action="../addPost">
<table style="line-height: 50px;">

<tr><td><input type="hidden" name="bor_id" id="bor_id2" value=""></td></tr>
<tr><td>主题(*):</td><td><input type="text" name="ptmain" id="ptmain2" class="form-control" placeholder="请输入您要发表的主题" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>发布人:</td><td><input type="text" class="form-control" id="author_id2" name="author_id" style="width: 450px;margin-left: 20px;" value="${obj.uname }"></td></tr>
<tr><td>来源:</td><td><input type="text" name="source" id="source2" class="form-control" placeholder="请输入您发表信息的来源" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>内容: &nbsp;</td><td><textarea cols="66" rows="4"  id="content2" name="content" id="reasons" placeholder="请输入您发表的内容" style="width: 450px;margin-left: 20px;"></textarea></td></tr>
</table>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<!-- <button type="button" class="btn btn-primary" data-dismiss="modal">发表</button> -->
<input type="button" class="btn btn-primary" data-dismiss="modal" value="发表" onclick="modifySend()">
</div>
</div>
</div>
</div>
</div>

<!-- 删除模态框（Modal） -->
<div class="modal fade" id="deleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">温馨提示</h4>
</div>
<div class="modal-body">删除就没有了哦  亲</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="getDelete()">确定</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>

<!-- 待审批的帖子 -->
<div class="sec_menu" id="yinsi" style="display:none">
		<div class="sty1" id="styl1">
	<div id="mian1">
	<div class="input-group input-group-sm">
	<span class="input-group-addon">版块</span>
					<select name="bor_name" class="form-control" id="grade3" onchange="getBoreds()">
						 <option value="0" selected="selected" >请选择查找版块</option>	 
					</select>
					<input type="hidden" id="bor_id3" name="bor_id" value="0">
	<span class="input-group-addon">主题</span>
	<input type="text" id="ptmain3" class="form-control" placeholder="请输入您要查找的主题">
						
	</div>
	
	<div id="zhong">
		<div class="input-group input-group-sm">
	<span class="input-group-addon">开始时间</span>
<input type="text" class="form-control" id="startDate3" placeholder="请输入您要查找的开始时间" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" >

<span class="input-group-addon">结束时间</span>
<input type="text" class="form-control" id="endDate3" name="posted" placeholder="请输入您要查找的结束时间" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" >					
</div> 
	
			<button type="button" class="btn btn-success" id="button" onclick="getSearchs(1)">查询</button>	
	</div>
	</div>
	<div id="zhong2">
	<button type="button" class="btn btn-success"  data-toggle="modal" data-target="#myModal1">发表新贴</button>
	<button type="button" class="btn btn-danger"  data-toggle="modal" data-target="#deleModal1">清除数据</button>
	</div>
<table class="table table-bordered" id="table2">

<thead>
 <tr class="success">
<th><input type="checkbox" id="check1" onclick="applyAll()"></th>
<th>主题</th>
<th>发布人</th>
<th>来源</th>
<th>阅读次数</th>
<th>状态</th>
<th>版块</th>
<th>发布时间</th>
<th>操作</th>
</tr>
</thead>
<tbody >

</tbody>
</table>
<div id="laypage1"></div>
</div>
<!-- 修改编辑模态框（Modal） -->
<div class="modal fade" id="updateModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">编辑</h4>
</div>
<div class="modal-body">
<form action="../addPost">
<table style="line-height: 50px;">

<tr><td><input type="hidden" name="bor_id" id="bor_id4" value="0"></td></tr>
<tr><td>主题(*):</td><td><input type="text" name="ptmain" id="ptmain4" class="form-control" placeholder="请输入您要发表的主题" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>发布人:</td><td><input type="text" class="form-control" id="author_id4" name="author_id" style="width: 450px;margin-left: 20px;" value="${obj.uname }"></td></tr>
<tr><td>来源:</td><td><input type="text" name="source" id="source4" class="form-control" placeholder="请输入您发表信息的来源" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>内容: &nbsp;</td><td><textarea cols="66" rows="4"  id="content4" name="content" id="reasons" placeholder="请输入您发表的内容" style="width: 450px;margin-left: 20px;"></textarea></td></tr>
</table>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

<input type="button" class="btn btn-primary" data-dismiss="modal" value="发表" onclick="modifySends()">
</div>
</div>
</div>
</div>

	<!-- 新增新帖模态框（Modal） -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">发表新帖</h4>
</div>
<div class="modal-body">
<form action="../addPost">
<table style="line-height: 50px;">
<tr ><td>版块(*):</td><td><select name="ptboard" class="form-control" id="grade5" style="width: 450px;margin-left: 20px;" onchange="getBoreds()">
						<option value="请选择版块" selected="selected" value="0">请选择查找版块</option>
					</select>
</tr>
<tr><td><input type="hidden" name="bor_id" id="bor_id5" value="0"></td></tr>
<tr><td>主题(*):</td><td><input type="text" name="ptmain" id="ptmain5" class="form-control" placeholder="请输入您要发表的主题" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>发布人:</td><td><input type="text" class="form-control" id="author_id5" name="author_id" style="width: 450px;margin-left: 20px;" value="${obj.uname }"></td></tr>
<tr><td>来源:</td><td><input type="text" name="source" id="source5" class="form-control" placeholder="请输入您发表信息的来源" style="width: 450px;margin-left: 20px;"></td></tr>
<tr><td>内容: &nbsp;</td><td><textarea cols="66" rows="4"  id="content5" name="content" id="reasons" placeholder="请输入您发表的内容" style="width: 450px;margin-left: 20px;"></textarea></td></tr>
</table>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<!-- <button type="button" class="btn btn-primary" data-dismiss="modal">发表</button> -->
<input type="button" class="btn btn-primary" data-dismiss="modal" value="发表" onclick="showBors()">
</div>
</div>
</div>
</div>
<!-- 删除模态框（Modal） -->
<div class="modal fade" id="deleModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">温馨提示</h4>
</div>
<div class="modal-body">删除就没有了哦  亲</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="getDeletes()">确定</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!-- 删除模态框（Modal） -->
<div class="modal fade" id="approve" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">温馨提示</h4>
</div>
<div class="modal-body">是否确定审批 </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="getApprove()">确定</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</div>

<!--我发布的帖子  -->
<div class="sec_menu" id="fuwu" style="display:none;">
	<div class="sty1">
		<div class="font1" id="font1">
		<div class="input-group input-group-sm">
		<span class="input-group-addon">版块</span>
					<select name="bor_name" class="form-control" id="grade8" onchange="getBoreds()">
						 <option value="0" selected="selected" >请选择查找版块</option>	 
					</select>
					<input type="hidden" id="bor_id8" name="bor_id" value="0">
	<span class="input-group-addon">主题</span>
	<input type="text" id="ptmain8" class="form-control" placeholder="请输入您要查找的主题">
	</div>
		<div id="zhongdiv">
		<div class="input-group input-group-sm">
	<span class="input-group-addon">开始时间</span>
<input type="text" class="form-control" id="startDate2" placeholder="请输入您要查找的开始时间" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" >

<span class="input-group-addon">结束时间</span>
<input type="text" class="form-control" id="endDate2" name="posted" placeholder="请输入您要查找的结束时间" onClick="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'2008-03-08 11:30:00',maxDate:'2100-03-10 20:59:30'})" >					
</div> 
	
			<button type="button" class="btn btn-success" id="button" v-on:click="seachMePost(1)">查询</button>		
	</div>
</div>
<div id="zhong5">
	<button type="button" class="btn btn-success"  data-toggle="modal" data-target="#myModal">发表新贴</button>
	<button type="button" class="btn btn-danger"  data-toggle="modal" data-target="#deleModal">清除数据</button>
	</div>
<table class="table table-bordered" id="table1">

<thead>
 <tr class="success">
<th><input type="checkbox" id="check" onclick="applyAll()"></th>
<th>主题</th>
<th>发布人</th>
<th>来源</th>
<th>阅读次数</th>
<th>状态</th>
<th>版块</th>
<th>发布时间</th>
<th>操作</th>
</tr>
</thead>
<tbody > 
<tr v-for="list in data">
<td><input type="checkbox"  name='item'></td>
<td>{{list.ptmain}}</td>
<td>{{list.author_id}}</td>
<td>{{list.source}}</td>
<td>{{list.lookcount}}</td>
<td>{{list.state}}</td>
<td>{{list.ptboard}}</td>
<td>{{list.posted}}</td>
<td>操作</td>
</tr> 
 </tbody>
</table>
<div id="laypagess"></div>
	</div>
	</div>


<script type="text/javascript" src="../js/pages.js"></script>
<script type="text/javascript">
 var exm=new Vue({
	el:"#fuwu",
	data:{
		data:[],
		curr:'1',
	},
	methods:{
		seachMePost:function(){
			var bor_id=$("#bor_id8").val();
			var ptmain=$("#ptmain8").val();
			var startTime =$("#startDate2").val();
			var endTime =$("#endDate2").val();	
			var dom = this;
			var currentPage=this.curr;
		$.ajax({
			url:'<%=basePath %>/queryShowSend',
			type:'post',
			data:{bor_id:bor_id,ptmain:ptmain,currentPage:currentPage,startTime:startTime,endTime:endTime},
			dataType:'json', 
			success:function(res){
				console.log(res.meAppSend)
				dom.data=res.meAppSend
				 console.log(dom.data) ;
				  laypage({
					    cont: $("#laypagess"),
					    pages:res.count,  //假设我们获取到的是18（后端计算完总页数后将总页数值传过来，放在这里即可（类似{$totalpage}））.
					    groups:5, //显示几页码 
					    skip: true, //是否开启跳页
					    skin: '#AF0000',
					    curr:currentPage,  //假设我们获取到的是18（后端计算完总页数后将总页数值传过来，放在这里即可（类似{$totalpage}））.
					    groups:3, //显示几页码currentPage,		
					    jump: function(obj, first){ //触发分页后的回调
					        if(!first){ 	//一定要加此判断，否则初始时会无限刷新      
					        	dom.curr=(obj.curr);
					        	dom.seachMePost();
					        }
					    }
					});     
			}
		})
		}
	},
	 created:function(){
		this.seachMePost();
	} 
})  

</script>
</html>